﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="top.aspx.cs" Inherits="Rmlife.Web.top" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../styles/css.css" type="text/css" rel="stylesheet" />
    <link href="../styles/modelpopup.css" type="text/css" rel="stylesheet" />
    <style type="text/css">
        body { margin: 0; }
    </style>

    <script type="text/javascript" src="../js/modalpopup.js"></script>

    <script type="text/javascript" src="../xml/navmenu.js"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
</head>
<body>
    <div id="MenuTab">
        <ul id="MainMenu">
            <li class="MenuLogo">
                <img alt="" src="../images/logo.gif" />
            </li>
        </ul>
        <div class="SearchBar">
            <input type="hidden" id="searchtype" value="company" />
            <dl>
                <dt><span id="searcheoption" onclick="javascript:top.mainFrame.setseachmenu('block');"
                    style="cursor: hand">单位名称</span>
                    <button type="button" class="OutButton" onmouseover="this.className='OverButton'"
                        onmouseout="this.className='OutButton'" onclick="javascript:top.mainFrame.setseachmenu('block');"
                        onfocus="this.blur();">
                    </button>
                </dt>
                <dd>
                    <input id="searchinfo" onkeydown="if(event.keyCode==13){document.getElementById('dosearch').focus();}"
                        type="text" /></dd>
                <dd>
                    <button type="button" id="dosearch" class="SubmitButton" onclick="javascript:top.mainFrame.Search(escape(document.getElementById('searchinfo').value),document.getElementById('searchtype').value);">
                    </button>
                </dd>
            </dl>
        </div>
        <%if (config.FullScreen)
          { %>
        <div id="CloseID">
            <a href="javascript:void(0);" onclick="top.window.location='../logout.aspx';">
                <img alt="退出系统" src="../images/close.gif" border="0" /></a>
        </div>
        <%} %>
    </div>
    <div id="setting" style="display: none;">
    </div>
</body>
</html>

<script type="text/javascript">

    function LoadMainMenu() {
        var menuText = "";
        for (var i = 0; i < toptabmenu.length; i++) {
            var mod = (i % 7) + 1;
            menuText += "<li id='NtTab" + (i + 1) + "' ><div id='NtDiv" + (i + 1) + "'  Class='Currenttab" + mod + "'>";
            menuText += "<a href='#' id='NtA" + (i + 1) + "' class='CurrentHoverTab" + mod + "'";
            menuText += " onclick=\"javscript:locationurl('" + toptabmenu[i]["mainmenulist"].split(",")[0] + "','" + toptabmenu[i]["id"] + "','" + toptabmenu[i]["mainmenulist"];
            menuText += "','" + toptabmenu[i]["defaulturl"] + "');\" onfocus='this.blur();'>" + toptabmenu[i]["title"] + "</a></div></li>";
        }
        document.getElementById("MainMenu").innerHTML += menuText;
    }
    LoadMainMenu();


    function setseachtype(searchtype) {
        document.getElementById("searchtype").value = searchtype;
        switch (searchtype) {
            case 'company': document.getElementById("searcheoption").innerHTML = '单位名称'; break;
            case 'username': document.getElementById("searcheoption").innerHTML = '用户名'; break;
            case 'usercard': document.getElementById("searcheoption").innerHTML = '用户证件'; break;
            case 'guestname': document.getElementById("searcheoption").innerHTML = '访客名称'; break;
            case 'guestcard': document.getElementById("searcheoption").innerHTML = '访客证件'; break;
            case 'function': document.getElementById("searcheoption").innerHTML = '功能搜索'; break;
        }
    }

    function locationurl(showmenuid, toptabmenuid, mainmenulist, defaulturl) {
        var menucount = toptabmenu.length;
        j = menucount;

        /*得新进行实始化设置*/
        for (i = 1; i <= menucount; i++) {
            document.getElementById("NtDiv" + i).className = "tab" + (i % 7);
            document.getElementById("NtTab" + i).style.zIndex = j;
            document.getElementById("NtA" + i).className = "";
            j--;
        }


        /*设置当前点中的菜单项样式*/
        document.getElementById("NtA" + toptabmenuid).className = 'CurrentHoverTab' + (toptabmenuid % 7);
        document.getElementById('NtDiv' + toptabmenuid).className = 'Currenttab' + (toptabmenuid % 7);
        document.getElementById('NtTab' + toptabmenuid).style.zIndex = menucount + 1;

        //alert(encodeURIComponent( defaulturl));
        top.mainFrame.location.href = '../framepage/managerbody.aspx?showmenuid=' + showmenuid + '&toptabmenuid=' + toptabmenuid + '&mainmenulist=' + mainmenulist + '&defaulturl=' + encodeURIComponent(defaulturl);

    }

    document.getElementById("searchtype").value = 'company';
    locationurl(toptabmenu[0]["mainmenulist"].split(",")[0], toptabmenu[0]["id"], toptabmenu[0]["mainmenulist"], toptabmenu[0]["defaulturl"]);
</script>

